import datetime
from uuid import uuid4

import webview
from webview import Window


def get_window(window_id: str) -> Window:
    """
    获取指定窗口
    :param window_id:
    :return:
    """
    for window in webview.windows:
        if window.uid == window_id:
            return window


def uuid() -> str:
    return uuid4().hex


def get_current_time(f="%Y-%m-%d %H:%M:%S") -> str:
    now = datetime.datetime.now()
    return now.strftime(f)
